# -*- coding: utf-8 -*-
# Created on Sun May 05 14:07:31 2013
# Insert sort. Page 17

def InsertSort(A):
    for j in range(1, len(A)):
        key = A[j]
        i = j-1
        while i>=0 and A[i] > key:
            A[i+1]= A[i]
            i = i-1
        A[i+1] = key


if __name__ == '__main__':
    A = [5,2,4,6,1,3]
    InsertSort(A)
    output = '['
    for a in A:
        output += str(a)+','
    print output+']'